package com.microfch.ninetypetest;


import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.widget.Button;


import com.microfch.p.MainActivityP;

public class MainActivity extends AppCompatActivity {
    public final String TAG = this.getClass().getSimpleName();

    MainActivityP p = null;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        setTitle(R.string.app_titile);
        initView();


    }

    private void initView() {
        RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
        Button submit = (Button)findViewById(R.id.submit_button);
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
        recyclerView.setLayoutManager(linearLayoutManager);
      //  recyclerView.addItemDecoration(new DividerItemDecoration(this,DividerItemDecoration.VERTICAL));

        p = MainActivityP.getInstance();
        p.setContext(this);
        p.initView();
        p.initRecyclerView(recyclerView);
        submit.setOnClickListener( p);

        Log.d(TAG,"initView");
    }

}
